/*
 * @Author: Shane
 * @Date: 2022-06-23 15:15:37
 * @LastEditTime: 2022-07-05 10:32:14
 * @LastEditors: Shane
 * @Description: 通用导航条
 * @FilePath: /app-product/Users/shane/Desktop/com/app-framework/common_widgets/lib/app_bar/app_bar.dart
 */

import 'package:flutter/material.dart';

import 'app_bar_base.dart';

class KKAppDoubleTitleBar extends KKAppBarBase {
  KKAppDoubleTitleBar(
    String title,
    String subTitle,
    BuildContext context, {
    Key? key,
    TextStyle titleTextStyle = const TextStyle(
      color: Color(0xFF303133),
      fontSize: 16,
      fontWeight: FontWeight.bold,
    ),
    TextStyle subTitleTextStyle = const TextStyle(
      color: Color(0xFF999999),
      fontSize: 12,
    ),
    Color? backgroundColor,
    double? elevation,
    Brightness? brightness,
    bool centerTitle = true,
    Widget? leading,
    double leadingWidth = 56,
    double? titleSpacing,
    double rightPadding = 20,
    Function()? onTapCallback,
    List<Widget>? actions,
  }) : super(
          context,
          key: key,
          title: Padding(
            padding: EdgeInsets.only(
              right: rightPadding,
            ),
            child: Column(
              crossAxisAlignment: centerTitle
                  ? CrossAxisAlignment.center
                  : CrossAxisAlignment.start,
              children: [
                Text(
                  title,
                  style: titleTextStyle,
                ),
                Text(
                  subTitle,
                  style: subTitleTextStyle,
                )
              ],
            ),
          ),
          centerTitle: centerTitle,
          backgroundColor: backgroundColor ?? Colors.white,
          elevation: elevation ?? 0,
          leadingWidth: leadingWidth,
          leading: leading,
          titleSpacing: titleSpacing,
          onTapCallback: onTapCallback,
          actions: actions,
        );
}
